package com.yanqu.road.server.cmd.banquet.cross;

import com.yanqu.road.entity.banquet.UserBanquetRecord;
import com.yanqu.road.pb.banquet.CrossBanquetProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.banquet.BanquetModule;
import com.yanqu.road.server.pb.BanquetPb;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_BANQUET_CROSS_USER_SEND_RECORD, desc = "跨服私人宴会记录发回本服")
public class SendUserBanquetRecordCmd extends AbstractCommand {


	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		CrossBanquetProto.SendCrossUserBanquetRecordMsg reqMsg = CrossBanquetProto.SendCrossUserBanquetRecordMsg.parseFrom(packet.getBytes());
		UserBanquetRecord userBanquetRecord = BanquetPb.parseToBanquetRecord(reqMsg);
		player.getModule(BanquetModule.class).addCrossUserBanquetRecord(userBanquetRecord);
	}

	@Override
	public void sendData(GamePlayer player) {

	}
}
